package active.memento.jingdian;

public class ClientJinDianMemento {
    public static void main(String[] args) {
        CareTaker careTaker = new CareTaker();

        Originator originator = new Originator();
        originator.setState("state #1");
        originator.setState("state #2");
        careTaker.add(originator.saveStateToMemento());
        originator.setState("state #3");
        careTaker.add(originator.saveStateToMemento());
        originator.setState("state #4");
        System.out.println("current state: " + originator.getState());
        System.out.println("0: " + careTaker.get(0).getState());
        System.out.println("1: " + careTaker.get(1).getState());
    }
}

